import kotlin.math.absoluteValue

class Player02(
    //下划线定义的为临时变量，只用一次
    _name: String,
    _age: Int,
    _isNormal: Boolean
) {
    var name = _name
        get() = field.capitalize()
        private set(value) {
            field = value.trim()
        }
    var age = _age
        get() = age.absoluteValue
        set(value) {
            field = age.absoluteValue
        }
    var isNormal = _isNormal
}

fun main() {
    val player02 = Player02("jack", 20, true)
    //private set name不可见
//    player02.name = ""
}